<template>
	<!-- 钱包明细 -->
	<view class="conetnt display  displayColumn width_750">
		<u-navbar @rightClick="rightClick" :autoBack="true" :placeholder="true">
			<template slot="left">
				<uni-icons type="left" color="#212121;" size="23" ></uni-icons>
			</template>
			<template slot="center">
				<text class="fontSize font_comm title">钱包明细</text>
			</template>
		</u-navbar>
		
			<!-- 计算滚动 -->
			<!-- 列表 -->
			<scroll-view id="ceshi" scroll-y="true" class="scroll-Y " :style="{height: scrollHeight}">
				<view class="fn_content display  width_750 displayColumn all_item">
					<!-- 卡片 -->
					<block v-for="(item,index) in arr" :key="index">
					<cardVue :item="item"></cardVue>
					</block>
					<view class="display width_750" style="height: 100rpx;"></view>
				</view>
			</scroll-view>
			
		
		
		
		
	</view>
</template>

<script>
	import cardVue from './card.vue'
	export default {
		components:{
			cardVue
		},
		data() {
			return {
				arr:[],
				scrollHeight:'90vh'
			}
		},
		onReady() {
		      const that = this
		      this.$nextTick(() => {
		        uni.getSystemInfo({
		          success: function (res) {
		            const query = wx.createSelectorQuery()
		            query.select('#ceshi').boundingClientRect()
		            // 获取滚动容器css数据
		            query.exec((resData) => {
						console.log(resData)
		              if (resData && resData.length) {
		                // 容器高度 = 可使用窗口高度 - 滚动容器距离顶部位置
		                that.scrollHeight = (res.windowHeight - resData[0].top)*2  + 'rpx'
						console.log(that.scrollHeight)
		              }
		            })
		          },
		        })
		      })
			},
			onLoad(){
				// 获取列表
				this.getList();
							},
		methods: {
			getList(){
				this.$modal.loading('加载中');
				let data = {
					pageSize:10,
					pageNum:1
				}
				this.$req.get('/xcx/userPayLog/list',data).then(res=>{
					this.$modal.closeLoading();
					console.log(res)
					if(res.data.code==200){
						this.arr = this.arr.concat(res.data.rows);
					}else{
						this.$modal.msg(res.data.msg);
					}
				})
			}
		}
	}
</script>

<style scoped lang="scss">
.title {
		font-weight: 600;
		font-size: 34rpx;
		color: #232323;
	}
</style>
